home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d10
/
chrpro3.arc
/
MCONREPT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
5KB
|
211 lines
* Program MCONREPT - Generates a brief office report for a month.
Select secondary
Use
Select primary
Store str(val(OT)-1,1) to CTSF
Store F to EOY
If wknummax=6
Store 60 to lastcurln
USE CONTRIBT
If $(curdates,1,2)='12'
Store T to EOY
endif
else
Store 50 to lastcurln
USE CONTRIBU
If $(curdates,1,2)='10'
Store T to EOY
endif
endif
Store d+':CONTRIBX' to XX
If file(XX)
delete file &XX
endif
Copy to &XX structure
Select secondary
USE &XX
Select primary
Use &MFILE
Store 0 to recc
Store 0 to recnum
Store 0 to pagenum
Store ' ' to curline
If OSEL='3'
? 'Ready the printer for the Contributions Report.'
Store "printing this month's office report and " to curline
Set format to print
Store trim(cmonthco)+', '+cyearcon to CNAME
endif
Set raw on
? "Now ",curline,"creating next month's CONTRIBX file."
Set raw off
Store 62 to curline
Set exact on
Do while .not. EOF
If OSEL='3'
If curline >= lastcurln
If pagenum>0
EJECT
endif
Store pagenum+1 to pagenum
@ 1,10 say chname+' Contributions Report for '+CNAME
@ 1,66 say 'Page'+str(pagenum,3)
@ 4,1 say 'Envl # '+HDR3
Store 6 to curline
endif
endif
Store 1 to wknumb
Store 0.00 to GIVING1
Store 0.00 to GIVING2
Store 0.00 to GIVING3
Store 0.00 to GIVING4
Store 0.00 to GIVING5
Do while wknumb<wknummax
Store '0' to N
Store ' ' to wktotls
Store ' ' to WKSF
do while N<>OT
Store str(val(N)+1,1) to N
Store $(ocateg&N,wknumb*8+2,8) to onecontr
If onecontr=' 0.00'
Store ' ' to onecontr
endif
Store wktotls+' '+onecontr to wktotls
enddo
If CSA<>' '
Store $(wktotls,1,50)+$(spaccounts,wknumb+1,1)+$(wktotls,52,10) to wktotls
endif
If wktotls<>' '
If OSEL='3'
@ curline,12 say $(curdates,wknumb*6-5,6)+wktotls
endif
Store curline+1 to curline
Store 0 to M
Store val(OT) to OTT
Do while M<>OTT
Store M+1 to M
Store str(M,1) to O
Store $(wktotls,M*12-8,8) to GIVING0
Store &GIVING0+GIVING&O to GIVING&O
enddo
endif
Store wknumb+1 to wknumb
enddo
If osel='3'
Store '0' to N
Store ' ' to GIVING
Do while N<>OT
Store str(val(N)+1,1) to N
Store GIVING+str(GIVING&N,12,2) to GIVING
enddo
@ CURLINE,0 SAY str(#,4)+' Year-to-date'+GIVING
Store curline+2 to curline
endif
Select secondary
APPEND BLANK
Store '0' to N
Replace MCONSTATUS with str(#,5)
If EOY
Replace PLEDGED with ' '
else
Replace PLEDGED with P.PLEDGED
Do while N<>OT
Store str(val(N)+1,1) to N
Replace OCATEG&N with STR(GIVING&N,9,2)
enddo
endif
Select primary
SKIP
Store recc+1 to recc
If recc = 20
Store recnum+20 to recnum
? recnum,' RECORDS PROCESSED'
Store 0 to recc
endif
ENDDO
EJECT
Set format to screen
Store recc+recnum to recnum
? recnum,' TOTAL RECORDS PROCESSED'
Select secondary
Use
Release OCATEGY1,OCATEGY2,OCATEGY3,OCATEGY4,OCATEGY5,OCATEGYT,RECC,RECNUM,
RELEASE PAGENUM,CURLINE,cname,pagenum,wknumb,OTT,OTSF,M,WKTOTALS,EOY
If CSA<>' '
? 'Now updating the Special Funds for next month/quarter.'
Set exact off
USE CDIRFILE
COPY TO CDIRFILX for #<102
Select primary
USE CDIRFILX
Index on CDIRINDEX to CDIRFILX
Use CDIRFILX index CDIRFILX
Select secondary
USE CDIRFILE index CDIRFILE
GOTO 51
Store ' ' to CSA
Do while .not. EOF
Store $(CDIRINDEX,1,2)+'.' to SFX
Store spact to tspact
Store 0.00 to SPFUNDT
SKIP
Do while CDIRINDEX=SFX
Store SPFUNDT+val($(spact,3,9)) to SPFUNDT
SKIP
enddo
Select primary
Store $(SFX,1,2)+' ' to SFX
Find &SFX
If #<>0
Replace cdirindex with SFX+' '+date()
Store val($(tspact,23,9))+SPFUNDT to SPFUNDT
Store str(SPFUNDT,9,2) to SPFUNDX
Replace spact with $(spact,1,22)+SPFUNDX
? 'SPECIAL FUND: ',$(cdirindex,1,3),spact
Store CSA+$(sfx,2,1) to CSA
endif
Select secondary
Store $(SFX,1,2) to sfx
Do while (cdirindex=SFX .or.$(CDIRINDEX,3,1)='*').and. .not. EOF
SKIP
enddo
enddo
Select primary
GOTO 49
Store len(CSA) to NN
IF NN>39
Replace spact with $(csa,2,38)
Store ' '+$(CSA,40,NN-39) to CSA
Store len(CSA) to NN
GOTO 50
endif
Replace spact with $(csa,2,NN-1)
If #=49
GOTO 50
Replace spact with ' '
endif
endif
USE
If OSEL='3'
? 'Contributions report is complete. '
endif
Accept 'The new CONTRIBX file has been built. Press <retn> ' to XX
RETURN
rinter for the Contributions Report.'
Store "printing this month's office report and " to curline
Set format to print
Store trim(cmonthco)+', '+cyearcon to CNAME
endif
Set raw on
? "Now ",curline,"creating next month's CONTRIBX file."
Set raw off
Store 62 to curline
Set exact on
Do while .not. EOF
If OSEL='3'
If curline >= lastcurln
If pagenum>0
EJECT